/*
 * @Description: 农事记录管理
 */
// import zhreq from "@/api/axios-threeline";
import axios from "@/api/axios";
export default {
  /**
   * @description: 获取所有农事记录表格列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getCulturalList(params) {
    let zhenpar = { ...params }
    return axios.post("/v3/agriculturalTask/agriculturalTask/queryPageByCondition", zhenpar);
  },
  /**
   * @description: 只查询农事记录表格列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getCulturalListhavehand(params) {
    let zhenpar = { ...params }
    return axios.post("/v3/agriculturalTask/agriculturalTask/queryPageByCondition", zhenpar);
  },
  /**
   * @description:模糊查询农事记录列表 *代表必填
   */
  getqueryList(params) {
    return axios.post("/agriculturalMaterial/queryByCondition", {
      auditFlag: 1,
      agriculturalMaterialNameLike: params
    });
  },
  /**
  * @description:模糊查询农事记录列表 *代表必填
  */
  getqueryImgList(params) {
    return axios.post("/agriculturalMaterial/queryByCondition", {
      auditFlag: 1,
      agriculturalMaterialNameLike: params
    });
  },
  /**
   * @description: 添加农事记录数据
   * @param {Object}  *
   */
  addmeslist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/addRecord', zhenpar);
  },
  // TODO:单个添加
  addmessingle(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/addSingleRecord', zhenpar);
  },
  /**
   * @description: 添加农事记录数据
   * @param {Object}  *
   */
  addMappermeslist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/addTask', zhenpar);
  },
  addMapperlist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    let zhenpar = { ...params }
    return axios.post('/agriculturalTask/addMapper', zhenpar);
  },
  /**
  * @description: 修改农事记录数据
  * @param {Object}  *
  */
  editmeslist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/edit', zhenpar);
  },
  /**
  * @description: 作废农事记录数据
  * @param {Object}  *
  */
  eesultlist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/abolish', zhenpar);
  },
  /**
  * @description: 修改农事记录数据
  * @param {Object}  *
  */
  editdeallist(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/deal', zhenpar);
  },
  /**
  * @description: 添加农事任务数据
  * @param {Object}  *
  */
  /**
  * @description: 删除农事记录数据
  * @param {Object}  *
  */
  delmeslist(params) {
    // params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/delListByNo', zhenpar);
  },
  /**
  * @description: 获取所有肥药双减列表 *代表必填
  * @param {String/Number} page *
  * @param {String/Number} size *
  */
  getMaterialInputList(params) {
    let zhenpar = { ...params,
      "farmingTypeNo": sessionStorage.farmingTypeNo
      // "organizationNo": sessionStorage.getItem("organizationNo")
    }
    return axios.post("/agriculturalMaterialInput/queryPageList2", zhenpar);
  },
  /**
  * @description: 获取获取批次名称 *代表必填
  * @param {String/Number} page *
  * @param {String/Number} size *
  */
  queryBatchListName() {
    // return axios.get(`/batch/queryListName`);
    return axios.post('/batch/queryByCondition', {
      "farmingTypeNo": sessionStorage.farmingTypeNo,
      "status": false
    })
  },
  /**
  * @description: 获取获取设施名称 *代表必填
  * @param {String/Number} page *
  * @param {String/Number} size *
  */
  queryFacilityListName() {
    // return axios.get(`/facility/queryListName`);
    return axios.post(`/facility/queryByCondition`);
  },
  /**
  * @description: 获取获取批次详情 *代表必填
  * @param {String/Number} page *
  * @param {String/Number} size *
  */
  querybatchzhujian(batchNo) {
    // return axios.get(`/facility/queryListName`);
    return axios.get(`/v3/batch/productionBatch/queryByNo?no=${batchNo}`);
  },
  queryFacilityName() {
    return axios.get(`facility/queryList`);
  },
  /**
  * @description: 获取获取设施名称 *代表必填
  * @param {String/Number} page *
  * @param {String/Number} size *
  */
  queryagriculturalMaterialListName() {
    return axios.get(`/agriculturalMaterialInput/queryAgriculturalMaterial`);
  },
  getEmployeeList() {
    return axios.post("v3/organization/personDepartmentMapper/queryByCondition", {
      organizationNo: sessionStorage.organizationNo
    });
  },
  getAgriculturalMachinery(params) {
    return axios.post('v3/agricultural-equipment/v1/equipment/queryPageList',{
      ...params
    })
  },
  // 获取编号
  getNOList(no) {
    return axios.get(`v3/batch/productionBatch/queryByNo?no=${no}&isEliminate=false`)
  }
};

